package com.itkang.command;

/**
 * <p>
 * 场景:
 * </p>
 *
 * @author york yuan
 * @version 1.0
 * @since 15/7/8下午4:15
 */
public class SimpleRemoteControl {
    Command slot;

    private SimpleRemoteControl(){}

    private void setSimpleRemoteControl(Command slot){
        this.slot = slot;
    }

    public void buttonWasPressed() {
        slot.execute();
    }


    public static void main(String[] args) {
        SimpleRemoteControl control = new SimpleRemoteControl();
        Light light = new Light();
        LightOnCommand lightOnCommand = new LightOnCommand(light);

        control.setSimpleRemoteControl(lightOnCommand);
        control.buttonWasPressed();
    }
}
